using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[Serializable]
public class SerializableList<T> : List<T>, ISerializationCallbackReceiver
{
    [SerializeField] private List<T> nums = new List<T>();

    public void OnBeforeSerialize()
    {
        
        nums.Clear();
        foreach (var item in this)
        { 
            nums.Add(item);
        }
    }
    public void OnAfterDeserialize()
    {
        this.Clear();
        for (var i = 0; i < nums.Count; i++)
        {
            this.Add(nums[i]);
        }
    }


}
